package com.acme.domain;

import java.util.LinkedList;
import java.util.List;

import com.acme.domain.response.OrderChangeInfo;

public class Responses {
	private static List<OrderChangeInfo> respList = new LinkedList<OrderChangeInfo>();
	
	public static List<OrderChangeInfo> get() throws InterruptedException{
		synchronized (respList) {
			if (respList.isEmpty()){
				respList.wait();
			}
			return respList;
		}
	}
	
	public static void add(OrderChangeInfo info){
		synchronized (respList) {
			respList.add(info);
			respList.notifyAll();
		}
	}
}
